﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="jquery.ajaxPost.js" company="JaguarLabs">
//   JaguarLabs 2013
// </copyright>
// <summary>
//   Handle the json ajax posts.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

$.ajaxPost = function (method, jData, success, error) {
    $.ajax({
        type: "POST",
        url: 'http://192.168.111.4:8080/TasksManagerService.svc/' + method + (jData ? ('/' + jData) : ''),
        contentType: "text/xml; charset=utf-8",
        dataType: "json",
        success: success,
        error: function showError(xhr, status, exc) { alert(xhr.statusText + '\r\n' + xhr.responseText); }
    });
};